﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:UX="clr-namespace:Coco.UX" 
                    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    xmlns:edc="clr-namespace:Microsoft.Expression.Controls;assembly=Microsoft.Expression.Drawing" 
                    xmlns:ec="clr-namespace:Microsoft.Expression.Controls;assembly=Microsoft.Expression.Controls"
                    xmlns:Converters="clr-namespace:Coco.Converters;assembly=Coco.Converters">
    
    <Converters:NotNullToVisibilityConverter x:Key="NotNullToVisibilityConverter" />
    <Converters:NumberGreaterThanToVisibilityConverter x:Key="NumberGreaterThanToVisibilityConverter" />
    <Converters:NumberGreaterThanToParameterConverter x:Key="NumberGreaterThanToParameterConverter" />
    <Converters:StringToPathGeometryConverter x:Key="StringToPathGeometryConverter"/>
    <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    
    <Style TargetType="UX:UXButtonWithPath">
        <Setter Property="Height" Value="25"/>
        <Setter Property="Width" Value="25"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="UX:UXButtonWithPath">
                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Path Data="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PathDataString, Converter={StaticResource StringToPathGeometryConverter}}" 
                                          Stretch="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PathOrImageStretch}" 
                                          Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground}" 
                                          Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" 
                                          Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>